|||##########################################################################
|||## A Macroquest2 Casino written by Grimshad & Killians
|||## casinolucky7.mac - Handles all lucky7 code
|||##########################################################################
|||---------------------------------------------------------------------------------------------------------Lucky7 Events
#event Lucky7 "#1# #*# 'Lucky7'"
#event Playlucky7 "#1# says, 'Play Lucky7'"

|||---------------------------------------------------------------------------------------------------------Lucky7 info
Sub Event_Lucky7(Line, Player)
	/if (${Debug}) /echo in Lucky7(${Player})
	/varset Player ${Player.Right[-2].Left[-1]}
	/delay ${TellDelay}
	/tell ${Player} In this game, you place your bet and then roll 20. If you get 7, you win 7 times your money. [Play Lucky7]?
/return
|||---------------------------------------------------------------------------------------------------------Lucky7
Sub Event_Playlucky7(Line, Player)
	/if (${Debug}) /echo in Playlucky7(${Player})
	/varset Player ${Player.Right[-2].Left[-1]}
	/if (!${Defined[${Player}]}) {
		/call BankedCheck ${Player}
		/if (!${Macro.Return}) /return
	}
	|||If player is still at blackjack or roulette table, don't let them switch games.
	/if (${${Player}[2]} == 3 || ${${Player}[2]} == 4) {
		/say ${Player}, Please wait until you are removed from your current table before starting a new game.
		/return
	}
	/call SetPlayerStatus ${Player} NONE 5 NONE
	/say ${Player}, Please place your [bet #] and /ran 10.
/return

Sub PlayerLucky7(Player, int RollMin, int RollMax, int Roll)
	/if (${Debug}) /echo in PlayerLucky7(${Player}, RollMin ${RollMin}, RollMax ${RollMax}, Roll ${Roll})
	|||Handle Wrong Roll
	/echo /if (${RollMin} || ${RollMax} != 10)
	/if (${RollMin} || ${RollMax} != 10) {
		/say ${Player}, Your roll was incorrect, please /ran 10.
	} else {

		/if (!${${Player}[3]}) {
			/say ${Player}, You need to [Bet #] before you can roll.
		} else {
			|||Handle Win
			/if (${Roll}==7) {
				/say ${Player} rolls 7!
				/say ${Player} hit the jackpot, +${Math.Calc[${${Player}[3]}*6]}!
				/call PlayerWins ${Player} ${Math.Calc[${${Player}[3]}*6]}
			|||Handle Loss
			} else {
				/say ${Player}, you rolled a ${Roll}. -${${Player}[3]}
				/call PlayerLoses ${Player} ${${Player}[3]}
			}
			/call ResetPlayerStatus ${Player} 5
		}
	}
/return
